#ifndef ACCOUNTLOGINNER_H
#define ACCOUNTLOGINNER_H

#include <QObject>


namespace Network {
class HttpRequest;
}
namespace Account{
class Loginner : public QObject
{
    Q_OBJECT
public:
    explicit Loginner(QObject *parent = 0);

public:
    bool login(QString userName, QString pass);
    void logout();

public slots:
    /**
     * @brief onLoginResponded : response duoc tra ve
     */
    void onLoginResponsed(Network::HttpRequest* httpRequest);

signals:
    void logined(bool successed, const QString &message, const QString &sessionKey);
    void logouted();

public:
    static Loginner *instance(QObject *parent = 0);

private:
    static Loginner *m_instance;
};


}

#endif // ACCOUNTLOGINNER_H
